Skip to content

feat(principal): map CalDAV room metadata properties - #8693

Merged
odzhychko merged 1 commit into
mainfrom
feature/room-metadata-v2
Aug 8, 2026
Merged

feat(principal): map CalDAV room metadata properties#8693
odzhychko merged 1 commit into
mainfrom
feature/room-metadata-v2

Conversation

@odzhychko

Copy link
Copy Markdown
Contributor

Make room metadata available on principle objects (e.g. returned by @/models/principal.js)

This implementation breaks with a few of the established patterns in @/models anticipating ongoing push for type-safety/ TypeScript:

  • introduce RoomPrincipal type
    • in the future we can have something like `type Principle = RoomPrincipal | RoomPrincipal
  • do type validation as early as possible
  • be strict with type validation
    • non-ambiguous types prevent parsing and error handling further up
  • do not fail for unexpected types
    • always discard with a warning
    • we are not fully in control of data sources

This PR just adapts what was build in #8263 to align with how we want to extend our models in the future.

@Rikdekker Thank you very much. Here is a summary of things I decide to do differently compared to #8263:

  • Keep properties undefined if is not a RoomPrincipal
    • null is now reserved for when it is a RoomPrincipal and a value was not provided or had an unexpected value
  • Parse roomSeatingCapacity and roomFeatures
  • Take string values as is without trimming
  • Took out logic for roomBuildingName
    • Seems more like a guessing of the building from a given convention
      • It is a really good heuristic, but I would rather put it outside the RoomPrincipal object
  • Adding roomBuildingStory
  • Taking roomAddress directly from the cdav-library object
  • exposing roomBuildingRoomNumber instead of roomNumber
    • seems a bit of a redudant property name but I like to stay close the properties names from the cdav-library object

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment thread src/models/principal/principal.ts Outdated
Comment on lines +25 to +33
export interface RoomPrincipalProperties {
roomType: string | null
roomSeatingCapacity: number | null
roomBuildingAddress: string | null
roomBuildingStory: string | null
roomBuildingRoomNumber: string | null
roomFeatures: string[] | null
roomAddress: string | null
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put all the interface in a types file please... "src/types/"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread src/models/principal/principal.ts Outdated
/**
* Properties shared between all principal types.
*/
export interface SharedPrincipalProperties {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call this something like "BasePrincipalProperties" istead of "Shared", at first I through this had something to do with sharing until I read the doc

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@odzhychko
odzhychko enabled auto-merge (squash) August 7, 2026 18:34
@odzhychko odzhychko added 3. to review Waiting for reviews Feature: Editor Feature: Scheduling Anything around scheduling meetings, free-busy, resources, attendees and so on labels Aug 7, 2026
Co-authored-by: Rik Dekker <rik@rikdekker.nl>
Assisted-by: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Oleksandr Dzhychko <hey@oleks.dev>
@odzhychko
odzhychko force-pushed the feature/room-metadata-v2 branch from 8d8e3f3 to 9cb8129 Compare August 7, 2026 18:38
@odzhychko
odzhychko merged commit 202a1bd into main Aug 8, 2026
39 of 40 checks passed
@odzhychko
odzhychko deleted the feature/room-metadata-v2 branch August 8, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews Feature: Editor Feature: Scheduling Anything around scheduling meetings, free-busy, resources, attendees and so on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants